<template>
	<footer class="purchase-footer">
		<div>
			<div>
				<span>合计：</span>
				<span v-if="defaultAddress">{{total | formatMoney}}</span>
				<span v-else>{{0 | formatMoney}}</span>
			</div>
			<div class="purchase-footer-btn">
				<button @click="btnClick" :disabled="!defaultAddress">提交订单</button>
			</div>
		</div>
	</footer>
</template>

<script>
	export default {
		name: "Footer",
		props: {
			total: {
				type: [Number, String],
				default: 0
			},
			defaultAddress: {
				type: null
			}
		},
		methods: {
			btnClick() {
				this.$emit('click');
			}
		}
	}
</script>
